package com.lys.eduservice.listener;

import com.alibaba.excel.context.AnalysisContext;
import com.alibaba.excel.event.AnalysisEventListener;
import com.lys.eduservice.entity.excel.SubjectData;
import com.lys.eduservice.service.EduSubjectService;

/**
 * @author Lyyyys
 * @version 1.0
 * @date 2021/4/28 23:10
 */


public class SubjectListener extends AnalysisEventListener<SubjectData> {

    //因为SubjectListner不能交给spring进行管理，需要自己new，不能注入其他对象
    //EasyExcel.read(in, SubjectData.class,new SubjectListener()).sheet().doRead();

    //不能使用数据库操作，那么将SubjectService通过构造器注入进来

    public EduSubjectService eduSubjectService;
    public SubjectListener() {}
    public SubjectListener(EduSubjectService eduSubjectService) {
        this.eduSubjectService = eduSubjectService;
    }

    //读取excel内容，一行一行进行读取
    @Override
    public void invoke(SubjectData subjectData, AnalysisContext analysisContext) {

    }

    @Override
    public void doAfterAllAnalysed(AnalysisContext analysisContext) {

    }

}
